-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redesign RegisterCallback API #3584
Conversation
3f6d0f0
to
d5ad5a4
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3584 +/- ##
=======================================
+ Coverage 78.9% 79.0% +0.1%
=======================================
Files 170 170
Lines 12460 12587 +127
=======================================
+ Hits 9834 9950 +116
- Misses 2417 2424 +7
- Partials 209 213 +4
|
RegisterCallback accept variadic Asynchronous instruments instead of a slice. Callback accept an observation result recorder to ensure instruments that are observed by a callback.
44a19e7
to
de250ca
Compare
de250ca
to
0a23626
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Check global instruments inter-op with RegisterCallback.
When you use the instrument's This will trip new users up. |
The delegated instruments are still not useable, I updated the gist to the new failure point. |
If by opentelemetry-go/metric/instrument/asyncfloat64.go Lines 61 to 73 in e8c6e45
opentelemetry-go/metric/instrument/asyncint64.go Lines 62 to 74 in e8c6e45
For example: opentelemetry-go/metric/example_test.go Lines 58 to 74 in e8c6e45
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked that the delegates work. I've not had time to check the rest of the changes.
If this doesn't clear it, you can override the Request changes.
Following open-telemetry#3584, this value and type are no longer used.
The Observe is not used to record measurements following open-telemetry#3584.
The Observe is not used to record measurements following #3584.
Following #3584, this value and type are no longer used.
Fix #3519
Fix #3583
Issues
As stated in #3519 and #3583, the current
RegisterCallback
method and relatedCallback
have the following issues:Meter
s.Redesign
Callback
The
Callback
type is updated to accept a newObserver
type.The
Observer
type matches what was introduced in #3507 for single instrument callbacks. It is used to make an observation for an instrument that is passed as an argument to one of its "typed" methods.This new design allows for the SDK implementation to hold a registry of instruments a
Callback
is registered with. When the callback is executed the SDK can then check that the observations made by a user apply to one of these registered instruments. It is able to block observations of non-SDK/non-same-Meter instruments and doesn't require the user to complete a context passing operation.